import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/view/login/index'
import Index from '@/view/index/index'
import Basic from './basic'
const _import = require('./_import_' + process.env.NODE_ENV)
Vue.use(Router)

export default new Router({
  mode: 'hash',
  linkActiveClass: 'active',
  routes: [{
    path: '/',
    redirect: '/login'
  }, {
    path: '/login',
    component: Login,
    name: 'login'
  }, {
    path: '/index',
    component: Index,
    name: '主页',
    redirect: '/welcome',
    children: [
      Basic,
      {
        path: '/yfuTable',
        name: 'yfuTable',
        component: _import('example/yfuTable')
      }, {
        path: '/yfuTreeDemo',
        name: 'yfuTreeDemo',
        component: _import('example/yfuTreeDemo')
      }, {
        path: '/yfuDialogDemo',
        name: 'yfuDialogDemo',
        component: _import('example/yfuDialogDemo')
      }, {
        path: '/yfuPanelDemo',
        name: 'yfuPanelDemo',
        component: _import('example/yfuPanelDemo')
      }, {
        path: '/yfuListPanelDemo',
        name: 'yfuListPanelDemo',
        component: _import('example/yfuListPanelDemo')
      }, {
        path: '/yfuListCheckBoxPanelDemo',
        name: 'yfuListCheckBoxPanelDemo',
        component: _import('example/yfuListCheckBoxPanelDemo')
      }, {
        path: '/yfuFormDemo',
        name: 'yfuFormDemo',
        component: _import('example/yfuFormDemo')
      }, {
        path: '/yfuRichTextDemo',
        name: 'yfuRichTextDemo',
        component: _import('example/yfuRichTextDemo')
      }, {
        path: '/uploadDemo',
        name: 'uploadDemo',
        component: _import('example/uploadDemo')
      },
      // {
      //   path: '/yfuUeditorDemo',
      //   name: 'yfuUeditorDemo',
      //   component: _import('example/yfuUeditorDemo')
      // },
      {
        path: '/organization',
        name: '组织管理',
        component: _import('organization/organization')
      },
      {
        path: '/allUserManager',
        name: '全部用户',
        component: _import('userManager/allUserManager')
      },
      {
        path: '/enableUserManager',
        name: '已启用',
        component: _import('userManager/enableUserManager')
      },
      {
        path: '/disableUserManager',
        name: '已停用',
        component: _import('userManager/disableUserManager')
      },
      {
        path: '/deleteUserManager',
        name: '已删除',
        component: _import('userManager/deleteUserManager')
      },
      {
        path: '/roleManager',
        name: '角色管理',
        component: _import('roleManager/roleManager')
      },
      {
        path: '/moduleManager',
        name: '模块管理',
        component: _import('moduleManager/moduleManager')
      },
      {
        path: '/permissionManager',
        name: '权限管理',
        component: _import('permissionManager/permissionManager')
      },
      {
        path: '/contactManager',
        name: '信息管理',
        component: _import('website/contact/contactManager')
      },
      {
        path: '/companyManager',
        name: '公司管理',
        component: _import('website/company/companyManager')
      },
      {
        path: '/newsManager',
        name: '公司动态管理',
        component: _import('website/company/newsManager')
      },
      {
        path: '/productManager',
        name: '公司产品管理',
        component: _import('website/company/productManager')
      }
    ]
  }, {
    path: '/404', component: _import('404'), hidden: true
  }, {
    path: '*', redirect: '/404', hidden: true
  }]
})
